package cn.xiaolang.function.design_pattern.state;

public class ApplyDemo {

    public static void main(String[] args) {
        TrialFlowContext context = new TrialFlowContext("Dean apply an account of personal business");
        context.setNode(new TrialNode("1"));
        context.setNextNode(new TrialNode("2"));
        TrialHandler.start(context);
        // 1 pass
        context.getNode().setTrialStatus(TrialStatus.PASS);
        TrialHandler.start(context);
        // 2 reject
        context.getNode().setTrialStatus(TrialStatus.REJECT);
        TrialHandler.start(context);
        // 1 pass
        context.getNode().setTrialStatus(TrialStatus.PASS);
        TrialHandler.start(context);
        // 2 pass
        context.getNode().setTrialStatus(TrialStatus.PASS);
        TrialHandler.start(context);
    }

}
